<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>bonus detail</title>
	<meta name="decorator" content="default"/>
</head>
<body>
	<tags:breadcrumb name="breadcrumb" />
	<div class="icon-buttons">
		<a id="return" data-role="button" data-icon="back" data-iconpos="notext" data-inline="true" href="#">返回</a>
	</div>
	<div class="form-input">
	    <div data-role="collapsible" data-collapsed="false">
	        <h5>新开卡</h5>
	        <div class="middleCls">
				<c:if test="${empty detail.storeConsumeNewCardList}">
					<h4>无记录</h4>
				</c:if>
				<c:if test="${not empty detail.storeConsumeNewCardList}">
					<table data-role="table" class="ui-responsive table-stroke">
						<thead>
							<tr>
								<th>消费日期</th>
								<th>客户</th>
								<th>卡名</th>
								<th>金额</th>
								<th>提成</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${detail.storeConsumeNewCardList}" var="newCard">
								<tr>
									<td>
										${fns:formatDate(newCard.storeConsume.consume_Time, "yyyy-MM-dd")}
									</td>
									<td>
										${empty newCard.storeConsume.customer ? '散客' : newCard.storeConsume.customer.name}
									</td>
									<td>
										${fns:getCard(0, newCard.card_type, newCard.card_id).name}
									</td>
									<td>
										${newCard.real_cost}
									</td>
									<td>
										${newCard.bonus }
									</td>
								</tr>
							</c:forEach>
				
						</tbody>
					</table>
				</c:if>
			</div>
	    </div>
	    <div data-role="collapsible" data-collapsed="false">
	        <h5>卡充值</h5>
	        <div class="middleCls">
				<c:if test="${empty detail.storeConsumeRechargeCardList}">
					<h4>无记录</h4>
				</c:if>
				<c:if test="${not empty detail.storeConsumeRechargeCardList}">
					<table data-role="table" class="ui-responsive table-stroke">
						<thead>
							<tr>
								<th>消费日期</th>
								<th>客户</th>
								<th>卡名</th>
								<th>金额</th>
								<th>提成</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${detail.storeConsumeRechargeCardList}" var="rechargeCard">
								<tr>
									<td>
										${fns:formatDate(rechargeCard.storeConsume.consume_Time, "yyyy-MM-dd")}
									</td>
									<td>
										${empty rechargeCard.storeConsume.customer ? '散客' : rechargeCard.storeConsume.customer.name}
									</td>
									<td>
										${fns:getCard(0, rechargeCard.card_type, rechargeCard.card_id).name}
									</td>
									<td>${rechargeCard.real_cost}</td>
									<td>${rechargeCard.bonus}</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</c:if>
			</div>
	    </div>
	    <div data-role="collapsible" data-collapsed="false">
	        <h5>购买产品</h5>
	        <div class="middleCls">
				<c:if test="${empty detail.storeConsumeBuyProductList}">
					<h4>无记录</h4>
				</c:if>
				<c:if test="${not empty detail.storeConsumeBuyProductList}">
					<table data-role="table" class="ui-responsive table-stroke">
						<thead>
							<tr>
								<th>消费日期</th>
								<th>客户</th>
								<th>产品</th>
								<th>数量</th>
								<th>金额</th>
								<th>提成</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${detail.storeConsumeBuyProductList}" var="buyProductCard">
								<tr>
									<td>
										${fns:formatDate(buyProductCard.storeConsume.consume_Time, "yyyy-MM-dd")}
									</td>
									<td>
										${empty buyProductCard.storeConsume.customer ? '散客' : buyProductCard.storeConsume.customer.name}
									</td>
									<td>
										<c:if test="${buyProductCard.storeProduct.product_type == 0 }">
											${buyProductCard.storeProduct.product.name}
										</c:if>
										<c:if test="${buyProductCard.storeProduct.product_type == 1 }">
											${buyProductCard.storeProduct.storeSelfProduct.name}
										</c:if>
									</td>
									<td>${buyProductCard.amount}</td>
									<td>${buyProductCard.real_cost_total}</td>
									<td>${buyProductCard.bonus}</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</c:if>
			</div>
	    </div>
	    <div data-role="collapsible" data-collapsed="false">
	        <h5>手工护理</h5>
	        <div class="middleCls">
				<c:if test="${empty detail.storeConsumeDoCareList}">
					<h4>无记录</h4>
				</c:if>
				<c:if test="${not empty detail.storeConsumeDoCareList}">
					<table data-role="table" class="ui-responsive table-stroke">
						<thead>
							<tr>
								<th>消费日期</th>
								<th>客户</th>
								<th>护理</th>
								<th>金额</th>
								<th>提成</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${detail.storeConsumeDoCareList}" var="doCareCard">
								<tr>
									<td>
										${fns:formatDate(doCareCard.storeConsume.consume_Time, "yyyy-MM-dd")}
									</td>
									<td>
										${empty doCareCard.storeConsume.customer ? '散客' : doCareCard.storeConsume.customer.name}
									</td>
									<td>
										<c:if test="${doCareCard.storeCare.care_type == 0 }">
											${doCareCard.storeCare.care.name}
										</c:if>
										<c:if test="${doCareCard.storeCare.care_type == 1 }">
											${doCareCard.storeCare.storeSelfCare.name}
										</c:if>
									</td>
									<td>
										<c:if test="${not empty doCareCard.card_id}">
											${doCareCard.real_cost}
										</c:if>
										<c:if test="${empty doCareCard.card_id}">
											时段卡耗卡
										</c:if>
									</td>
									<td>${doCareCard.bonus}</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
				</c:if>
			</div>
	    </div>
    </div>
    <script type="text/javascript">
		$(document).ready(function() {
			addParentPageNo();
		});
		function addParentPageNo() {
			var reportStart = sessionStorage.reportStartSecond;
			var reportEnd = sessionStorage.reportEndSecond;
			var	returnHref = "${ctx}/report/all/bonus?startDate=" +reportStart + "&endDate=" + reportEnd;
			$("#return").attr("href", returnHref);
		}
	</script>
</body>
</html>
